home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bitblt1 / frmmain.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-04  |  5.9 KB  |  176 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMAIN 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "BitBlt-Bitmap Block Transfer."
  5.    ClientHeight    =   3015
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4680
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   3015
  12.    ScaleWidth      =   4680
  13.    StartUpPosition =   2  'CenterScreen
  14.    Begin VB.Frame Frame1 
  15.       Height          =   2655
  16.       Left            =   120
  17.       TabIndex        =   0
  18.       Top             =   0
  19.       Width           =   4455
  20.       Begin VB.CommandButton cmdEXIT 
  21.          Caption         =   "&Exit"
  22.          Height          =   375
  23.          Left            =   3120
  24.          TabIndex        =   4
  25.          Top             =   600
  26.          Width           =   1215
  27.       End
  28.       Begin VB.CommandButton cmdRUN 
  29.          Caption         =   "&BitBlt"
  30.          Height          =   375
  31.          Left            =   3120
  32.          TabIndex        =   3
  33.          Top             =   240
  34.          Width           =   1215
  35.       End
  36.       Begin VB.Frame Frame3 
  37.          Caption         =   "Destination:"
  38.          Height          =   1575
  39.          Left            =   120
  40.          TabIndex        =   2
  41.          Top             =   960
  42.          Width           =   4215
  43.          Begin VB.PictureBox picDEST 
  44.             Appearance      =   0  'Flat
  45.             AutoRedraw      =   -1  'True
  46.             AutoSize        =   -1  'True
  47.             BackColor       =   &H80000005&
  48.             BorderStyle     =   0  'None
  49.             ForeColor       =   &H80000008&
  50.             Height          =   1200
  51.             Left            =   0
  52.             Picture         =   "frmMAIN.frx":0000
  53.             ScaleHeight     =   1200
  54.             ScaleWidth      =   4200
  55.             TabIndex        =   8
  56.             Top             =   240
  57.             Width           =   4200
  58.          End
  59.       End
  60.       Begin VB.Frame Frame2 
  61.          Caption         =   "Sources:"
  62.          Height          =   855
  63.          Left            =   120
  64.          TabIndex        =   1
  65.          Top             =   120
  66.          Width           =   1335
  67.          Begin VB.PictureBox picSRC1 
  68.             Appearance      =   0  'Flat
  69.             AutoRedraw      =   -1  'True
  70.             AutoSize        =   -1  'True
  71.             BackColor       =   &H80000005&
  72.             BorderStyle     =   0  'None
  73.             ForeColor       =   &H80000008&
  74.             Height          =   480
  75.             Left            =   720
  76.             Picture         =   "frmMAIN.frx":106C2
  77.             ScaleHeight     =   480
  78.             ScaleWidth      =   480
  79.             TabIndex        =   6
  80.             Top             =   240
  81.             Width           =   480
  82.          End
  83.          Begin VB.PictureBox picSRC0 
  84.             Appearance      =   0  'Flat
  85.             AutoRedraw      =   -1  'True
  86.             AutoSize        =   -1  'True
  87.             BackColor       =   &H80000005&
  88.             BorderStyle     =   0  'None
  89.             ForeColor       =   &H80000008&
  90.             Height          =   480
  91.             Left            =   120
  92.             Picture         =   "frmMAIN.frx":11304
  93.             ScaleHeight     =   480
  94.             ScaleWidth      =   480
  95.             TabIndex        =   5
  96.             Top             =   240
  97.             Width           =   480
  98.          End
  99.       End
  100.       Begin VB.Label lblINFO 
  101.          Caption         =   "Picture Boxs are being used for this program. Sorry for the crappy images."
  102.          BeginProperty Font 
  103.             Name            =   "Small Fonts"
  104.             Size            =   6.75
  105.             Charset         =   0
  106.             Weight          =   400
  107.             Underline       =   0   'False
  108.             Italic          =   0   'False
  109.             Strikethrough   =   0   'False
  110.          EndProperty
  111.          Height          =   735
  112.          Left            =   1560
  113.          TabIndex        =   7
  114.          Top             =   240
  115.          Width           =   1455
  116.       End
  117.    End
  118.    Begin VB.Label lblAUT 
  119.       Alignment       =   2  'Center
  120.       Caption         =   "DosAscii : dosascii@hotmail.com"
  121.       Height          =   255
  122.       Left            =   120
  123.       TabIndex        =   9
  124.       Top             =   2760
  125.       Width           =   4455
  126.    End
  127. Attribute VB_Name = "frmMAIN"
  128. Attribute VB_GlobalNameSpace = False
  129. Attribute VB_Creatable = False
  130. Attribute VB_PredeclaredId = True
  131. Attribute VB_Exposed = False
  132. 'Simple BitBlt.
  133. 'DosAscii.
  134. 'dosascii@hotmail.com
  135. 'All picture boxz are set to:
  136. 'Appearance = Flat
  137. 'AutoRedraw = True
  138. 'AutoSize = True
  139. 'BorderStyle = None
  140. Option Explicit 'This foreces all varibles to be declared now.
  141. Public XPos 'X-axis
  142. Public YPos 'Y-axis
  143. Private Sub cmdEXIT_Click()
  144. 'Unload all the resources.
  145. picSRC0.Picture = Nothing
  146. picSRC1.Picture = Nothing
  147. picDEST.Picture = Nothing
  148. 'Finaly, unload the app.
  149. Unload Me
  150. End Sub
  151. Private Sub cmdRUN_Click()
  152. 'Colour , Colour, Mask
  153. 'Colour , Colour, Colour
  154. ' Paint the Mask onto the Destination using AND operator.
  155. Call BitBlt(picDEST.hDC, XPos, YPos, picSRC0.ScaleWidth \ Screen.TwipsPerPixelX, picSRC0.ScaleHeight \ Screen.TwipsPerPixelY, picSRC1.hDC, 0, 0, SRCAND)
  156. ' Paint the Source onto the Destination using XOR operator.
  157. Call BitBlt(picDEST.hDC, XPos, YPos, picSRC0.ScaleWidth \ Screen.TwipsPerPixelX, picSRC0.ScaleHeight \ Screen.TwipsPerPixelY, picSRC0.hDC, 0, 0, SRCINVERT)
  158. ' Update the screen with the updated image in memory.
  159. picDEST.Refresh
  160. picSRC0.Refresh
  161. picSRC1.Refresh
  162. End Sub
  163. Private Sub Form_Load()
  164. 'Set the X and Y positions.
  165. XPos = 125
  166. YPos = 20
  167. End Sub
  168. Private Sub Form_Unload(Cancel As Integer)
  169. 'Unload all the resources.
  170. picSRC0.Picture = Nothing
  171. picSRC1.Picture = Nothing
  172. picDEST.Picture = Nothing
  173. 'Finaly, unload the app.
  174. Unload Me
  175. End Sub
  176.